steam_get_stat_float

语法:

steam_get_stat_float(stat_name);


参数 描述
stat_name The name of the statistic to get (a string).


返回: Real(实数)


描述

With this function you can get the value of a specific floating point statistic. The statistic should have been previously defined on the Steamworks control panel accounts page for your game and the string that is passed to the function should match that used as the API Name on the control panel.


例如:

var dist_pc = (dist / dist_max) * 100;
if steam_get_stat_float("Travelled") < dist_pc
   {
   steam_set_stat_int("Travelled", dist_pc);
   }

The above code calculates a percentage based on the distance travelled variable "dist" and the maximum distance you can travel "dist_max". It then polls the current value for the statistic "Travelled" and if it is less than the calculated value, it sets the stat again.